< previous page page_729 next page >

Page 729
For larger systems, such as an accounting application, you may want to group your tables by the subsystem in which the tables are modified directly by the application. Here are some examples of table names:
empInfo
empDesc
glAccounts
glPostings
arPostings
arReceipts
rptList
rptSelections
rptSorts
Each table in this list has a prefix that identifies the subsystem where that table is most directly modified: emp relates to the Employee module, gl to the General Ledger module, ar to the Accounts Receivable module, and rpt to the reporting module. Once again, just by looking at the table name, you get a good idea of where that table is used. You dont need to refer to any printed documentation just to determine what the table is used for.
Obviously, there will be times when a table is used in more than one module. In that case, you need to make a decision about what the prefix should be. Either choose one of the modules or make a new prefix to identify tables that are used in more than one module. A good example of this is tables that hold validation codes such as states and types. You may want to use the prefix val for these types of tablesfor example, valStates and valCustomerTypes.
Primary Key Definition
Its recommended you use an integer (Long) as your primary key for each table. This is a unique number that the user never sees; its used internally to uniquely identify each row. This also cuts down on the amount of fields in your WHERE clause. Additionally, you can place this value in the ItemData() property of a list or combo box for quick retrieval of the full information from the table for the text portion of the list or combo box. From a performance standpoint, this is very efficient, because most database systems perform joins on integer types quicker than any other type.

 
< previous page page_729 next page >

If you like this book, buy it!